<!DOCTYPE html>
<html>

<head>

</head>


<body>
    <form>
        <input type="button" id="button1" value="Button 1" />
    </form>

</body>

<script type="text/javascript">
    var btn = document.getElementById("button1");
    btn.onclick = function () {
        alert("Button 1 was clicked!")
    };
    btn.name = function () {
        document.write("123");
    };
    btn.name();
    console.log(btn.name)
  


    
</script>

</html>